package service

import (
	"context"
	"monoblog/common/register"
	"monoblog/domain/dto"
	"monoblog/domain/model"
)

func GetCommentService() CommentService {
	return register.GetInstance[CommentService]("CommentService")
}

type CommentService interface {
	Add(ctx context.Context, form dto.CommentReqForm) (string, error)

	StatusClose(ctx context.Context, id string) error

	FindList(ctx context.Context) ([]*model.Comment, error)

	// SubCommentsByRootId 获取根评论下的所有子评论
	SubCommentsByRootId(ctx context.Context, rootId string) ([]*model.Comment, error)

	CommentsByBlogID(ctx context.Context, blogId string) ([]*model.Comment, error)
}
